BIN=code
CC=gcc
SRC=$(wildcard  *.c)
OBJ=$(SRC:.c=.o)
LFLAGS=-o
CFLAGS=-c
RM=rm -f

$(BIN):$(OBJ)
	@$(CC) $(LFLAGS) $@ $^
	@echo "链接$^ 成为 $@"

%.o:%.c
	@$(CC) $(CFLAGS) $<
	@echo  "编译$< 成为 $@"
.PHONY:clean
clean:
	@$(RM) $(OBJ) $(BIN)
	@echo  "清理工程完毕"
